package com.grp6.game.controller;

import com.grp6.game.ui.platform.IAbstractUIPlatformFactory;

/**
 * This class initializes the framework. It represents the controller, creates model and view,<br/>  
 * and runs the game lifecycle.  
 * @author Group6
 */
public class GameLord {
	
	/**
	 * This method runs when the game is started which initializes the framework and 
	 * runs the gamelifecycle. The game lifecycle runs until the game comes to an end.
	 * @param args
	 * @throws ClassNotFoundException
	 * @throws InstantiationException
	 * @throws IllegalAccessException
	 */
	public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
		Class<IAbstractGameFactory> gfacclass = (Class<IAbstractGameFactory>) Class.forName(getGameFactoryClassName());
		IAbstractGameFactory gfac = gfacclass.newInstance();
		
		Class<IAbstractUIPlatformFactory> uifacclass = (Class<IAbstractUIPlatformFactory>) Class.forName(getGUIFactoryClassName());
		IAbstractUIPlatformFactory uifac = uifacclass.newInstance();
		
		IGameBuilder gameBuilder = gfac.createGameBuilder(uifac);
		AbstractGameLifecycle lifecycle = gameBuilder.build();		
		
		lifecycle.runLifecycle();
	}
	
	/**
	 * This method is used to load the Concrete implementation of AbstractGameFactory
	 * @return Class name of the Concrete class that implements AbstractGameFactory
	 */
	private static String getGameFactoryClassName() {
		// TODO Auto-generated method stub
		return null;
	}
	
	/**
	 * This method is used to load the Concrete implementation of AbstractUIPlatformFactory
	 * @return Class name of the Concrete class that implements AbstractUIPlatformFactory
	 */
	private static String getGUIFactoryClassName() {
		// TODO Auto-generated method stub
		return null;
	}
}
